-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to disable automatic EFI partitioning. #3458
Conversation
I'm not a 100% satisfied with this. I had to do API changes that I don't like. But we're not _1.0_ ready just yet, so… #1162 mentioned |
I've added a second commit, witch uses Either one seems fine, but I think I like the latter one better. "Luck have it", the |
My concern is there is already a label field called |
@DeHackEd I noticed this quite late in the 'rewrite', so I figured I could just as well use that instead of the original Didn't figure it mattered. |
@FransUrbo @DeHackEd actually these two things are directly related. They are one and the same. |
@behlendorf BECAUSE it have the same down-side as the |
1ec7b2f
to
bb82544
Compare
Ok, rebased as one commit using |
/* | ||
* This is somewhat counter-intuitive. | ||
* We've asked for whole disk, but we're | ||
* setting it to false. This because |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/This because/This is because/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that sounds strange… Would "That's because" be better?
@behlendorf @FransUrbo So any thoughts on "correct" behavior when the user explicitly sets -o whole_disk=on, and then proceeds to specify a partition? |
I'm a bit confused about usage here. Are we saying whole_disk=on means DO partition or DON'T partition? My understanding is that whole_disk=on should mean DO partition. |
The But what to do if user say:
I'm not sure... |
That's pretty much upside down of what I've always understood whole disk to mean in ZFS. |
Previously, |
Here "label" is essentially a synonym for "partition." |
I would highly recommend not turning this usage upside down. |
Same code in ZoL - https://github.com/zfsonlinux/zfs/blob/master/cmd/zpool/zpool_vdev.c#L526-L533. And I don't think it IS up-side-down. I think it makes perfect sense. Whole disk means exactly that in both use cases. I've clarified this somewhat:
|
The point is, I haven't really changed the behavior. I've extended it to mean the literal (obvious in my opinion) meaning. If I previously specified With this PR, I get the whole disk when I ask for it explicitly. |
Maybe I don't need to do anything about the counter-intuitive command line (specifying If the user say: I guess I can fail if both is specified, but I think that's a little overzealous... |
If I'm specifying whole_disk=on, it's because I'm overriding what zfs would do otherwise. zpool create tank sda ZFS will by default decide sda is a whole disk and will set whole_disk=on. Because whole_disk=on, we will partition the device. Because whole_disk=on, we will chop off the partition from zpool status output. Because whole_disk=on, we will take the responsibility of repartitioning when using online -e in place. So I intervene, and set -o whole_disk=off because I do not want the default. Now ZFS knows not to partition it. If it's not a whole disk, then there's no need to partition it. Now suppose I had what might appear to be a whole disk but isn't really because it's virtual (loopback, zvols, /dev/ram, etc.). ZFS notices that even though the device name appears to be a whole disk, it's not really, so there's no reason to partition it. But I disagree with that default decision. I want to force ZFS to believe this is a whole disk even though it's virtual because I want to use it as a VM boot drive. (Note that on Solaris, lofiadm does not support partitions.) On Linux and OS X, it is often quite "normal" to partition devices even if they're technically virtual. Therefore, I wish to override ZFS's default decision that the virtual device isn't really whole_disk=on material. So I force it, -o whole_disk=on. Now ZFS knows I expect it to partition it, and then use the resulting partition, as well as chop off the partition when displaying the device in zpool status, etc. |
If you say If/when you say Also, ZFS/ZoL haven't really set |
If you want the term to mean something else, use a different term. whole_disk=on precisely means DO try the "clever" stuff such as automatically partitioning it. |
No, you're misunderstanding the word whole. Whole means … entire, total :). If you DON'T want the whole thing, then set it to |
openzfs ~ # zpool history o3xpool | grep 'zpool create' openzfs ~ # zdb -l /dev/sdb1 | grep whole_disk | sort | uniq /dev/sdb1 is a whole_disk=on vdev. |
That's because This is still true with this PR. But the added meaning is, when you use it explicitly, you're meaning exactly that - use the whole disk, don't be "funny" about it. |
#3458 (comment) |
Yes, my point exactly which I've been trying to get you to understand for the last hour or so… There IS no change in behavior. Whole disk STILL means "whole disk". |
We will clearly have to agree to disagree. I'd expect whole_disk=on to mean "please partition" AND to result in whole_disk=1 on the label of the just-birthed partition(s), and I'd expect whole_disk=off to mean "please don't partition" AND to result in whole_disk=0 on the label of whatever it is that was literally specified. |
This discussion have shown a problem with the PR.
The culprit here is It assumes that we're expecting partitions on the device, and only if that is true, does it set I still think this is the correct, logical result following the rules of the english language. But it should in this case also set Technically, I think it's wrong to call |
@ilovezfs @DeHackEd I think I know now where you both went wrong. You both seems to believe that The fact that it DO partition the device is only because of "old habit" (worst excuse ever if you ask me :) - that's what Solaris did. But these two is just coincidental. This is simply a part of the second part "do with it as we please". What I've done here is clarifying the use - whole_disk STILL mean exactly that (when used by This is, I'm sure, what @behlendorf meant with the comment "these two things are directly related. They are one and the same". If I misunderstood you @behlendorf, I'm sorry for putting words in your mouth. I'll see if I can improve on the manpage(s) to make this more obvious, because if you two got it wrong, I bet more people would. |
I know what the current (label only) setting means. My only concern was that using "-o whole_disk" to mean something else could potentially be confusing to users at first when they see it - that they could force the whole_disk property on and ZFS might go ahead with its cache and elevator changes. Or how making it "settable only at pool creation time" (as opposed to vdev addition or replacement time) conflicts with expectations compared to how ashift works. Then again I'm the kind of guy who would just abuse the device mapper to make a disk the way he wants anyway if this feature doesn't exist. :) |
You say that you know what the current label means, and yet you insist on misunderstanding it. You're basically saying that "use whole disk" ( This is completely illogical and contra to what the word whole means and indicates. |
Even the code agrees with me here:
|
Using the whole_disk property should have zero effect on the command in
|
@aarcane yes -o whole_disk=on + a specific partition of your choice could make sense but it would require more changes, as the current code assumes we know which partition was anointed: |
Dang, it seems it wasn't as simple as just 'faking' the This is later in the function (https://github.com/zfsonlinux/zfs/blob/master/cmd/zpool/zpool_vdev.c#L729-L730) to set this value in the nvlist. This in turn is then used in And that seems to be the reason why |
bb82544
to
354d6d9
Compare
I've pushed a new version where I moved the 'faking' of the Still need to figure out how to cleanly and correctly make sure that the |
@FransUrbo, if you are going to rebuild the debian packages for #1350, please consider to pull this commit as well. It seems to be the only was to create partition-less (=auto-growable) pools... |
I only decided to include pull requests that isn't "dangerous" (in one way or the other) and this PR isn't quite finished. There's still a couple of things that we need to discuss and iron out. |
BTW, here's my current workaround:
|
We should not use whole_disk=1 to mean no partitioning because it should serve the function of allowing us to override the default choice of whole_disk in pool creation. We should have a different property, such as Also, we probably should think about being able to specify reserved space too for overprovisioning. That would be useful on SLOG devices. There is no need to tackle that alongside of this, but we should try to avoid implementing this in a way that makes it difficult to do that in the future. Going with whole_disk=1 (i.e. a boolean) to mean no partitioning is going to make implementing an overprovisioning switch in the command awkward in comparison to something extensible like partition=raw (i.e. a string). |
Sometimes it is desired to not have 'zpool' setup partitioning on devices it uses for the pool. So allow '-o whole_disk={on,off}' option to 'add', 'attach', 'create', 'replace' and 'split' to disable or enable, respectivly, the automatic partitioning. Signed-off-by: Turbo Fredriksson [email protected] Closes openzfs#94 Closes openzfs#719 Closes openzfs#1162 Closes openzfs#3452
354d6d9
to
aea9f90
Compare
I think @ryao's suggestion of a new If this pull request can be refreshed and a few test cases added we can definitely look in to making this change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is functionality many people would clearly like to have but we need to settle on the best interface for controlling it.
Personally I like @ryao's suggestion of a new partition=<raw|default|gpt>
property. The existing whole_disk` value which is stored in the label is an internal detail and really not something which should be exposed to users.
As part of this work I think it would be great to have some way to control the size of those partitions and a test case for this behavior.
Better suggestions for an interface are welcome. If someone would like to work on this please go ahead and open a new PR.
I think |
Sometimes it is desired to not have 'zpool' setup partitioning on devices it uses for the pool. So add a '-D' option to 'add', 'attach', 'create', 'replace' and 'split' to disable the automatic partitioning.
Signed-off-by: Turbo Fredriksson [email protected]
Closes #94
Closes #719
Closes #1162
Closes #3452